﻿<UserControl x:Class="DIST.LR.ZHJG.Controls.Chart.ucVFCircularGauge"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vg="clr-namespace:Visifire.Gauges;assembly=SLVisifire.Gauges"
    mc:Ignorable="d"
    d:DesignHeight="180" d:DesignWidth="300">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <vg:Gauge x:Name="vfCircularGauge"  Type="Circular" Width="300" Height="180" DefaultTemplate="CircularGaugeHalfNStyle" OuterBackground="Transparent" Background="Transparent" OuterCornerRadius="5" Margin="1,0,-1,0">
            <!--内仪表盘设置-->
            <vg:Gauge.CircularScales>
                <vg:CircularScale BorderThickness="1" ScaleThickness="0" Radius="1.3" Center="0.5,0.85" StartAngle="180" SweepAngle="180" Minimum="{Binding Minimum}" Maximum="{Binding Maxmum}">

                    <vg:CircularScale.MajorTicks>
                        <vg:MajorTicks Placement="Inside" Background="White" TickLength="0.30" TickWidth="0.02"/>
                    </vg:CircularScale.MajorTicks>

                    <vg:CircularScale.MinorTicks>
                        <vg:MinorTicks Placement="Inside" Background="White" TickLength="0.2" TickWidth="0.01"/>
                    </vg:CircularScale.MinorTicks>

                    <vg:CircularScale.ScaleLabels>
                        <vg:ScaleLabels FontSize="15" Placement="Outside" FontColor="#3E95DC" FontWeight="Bold" />
                    </vg:CircularScale.ScaleLabels>

                </vg:CircularScale>
            </vg:Gauge.CircularScales>
            <!--指针设置,Value值需要作为参数传入-->
            <vg:Gauge.Indicators>
                <!--<vg:NeedleIndicator LabelText="Value : #Value"/>-->
                <vg:NeedleIndicator Value="{Binding Value}" IndicatorWidth="0.15"  CapWidth="0.3" BorderThickness="0">
                    <!--指针颜色设置-->
                    <vg:NeedleIndicator.Background>
                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                            <GradientStop Color="#0241B1" Offset="1"/>
                            <GradientStop Color="#3085D0" Offset="0.5"/>
                            <GradientStop Color="#3085D0" Offset="0"/>
                        </LinearGradientBrush>
                    </vg:NeedleIndicator.Background>
                    <!--指针圆圈颜色设置-->
                    <vg:NeedleIndicator.CapBackground>
                        <RadialGradientBrush>
                            <GradientStop Color="#F4F5F7" Offset="1"/>
                            <GradientStop Color="#0241B1" Offset="0.5"/>
                            <GradientStop Color="#0241B1" Offset="0"/>
                        </RadialGradientBrush>
                    </vg:NeedleIndicator.CapBackground>

                </vg:NeedleIndicator>
            </vg:Gauge.Indicators>

            <vg:Gauge.Ranges>
                <vg:Range StartValue="{Binding Minimum}" EndValue="{Binding Maxmum}" StartWidth="0.25" EndWidth="0.25" Background="#C3DEF1" BorderThickness="0" BorderBrush="#753226" ShadowEnabled="False"></vg:Range>
            </vg:Gauge.Ranges>
        </vg:Gauge>
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="30,20,0,0" Name="textBlock1" Text="{Binding Value}" FontSize="20" FontWeight="Bold" Foreground="#0B53B7" VerticalAlignment="Top" />
    </Grid>
</UserControl>
